package com.ag.hmk.service.impl;

import java.util.List;

import com.ag.bean.TbExpertArea;
import com.ag.common.IDUtil;
import com.ag.hmk.dao.HmkTbExpertAreaDAO;
import com.ag.hmk.service.ExpertAreaService;

/**
 * 
 * @author  黄木看
 *专家领域接口服务的实现
 */
public class ExpertAreaServImpl implements ExpertAreaService {

	private HmkTbExpertAreaDAO hmkTbExpertAreaDAO;
	
	/*
	 * 删除一条专家领域记录
	 */
	public void delExpertArea(TbExpertArea expertArea) {
		if (expertArea!=null) {
			expertArea.setA(IDUtil.DELETE);
			hmkTbExpertAreaDAO.attachDirty(expertArea);
		}
		
	}

	/*
	 * 查询所有专家领域表的记录
	 */
	public List<TbExpertArea> findAllExpArea() {
		return hmkTbExpertAreaDAO.findByA(IDUtil.PRESERVE);
	}

	/*
	 * 查询一条专家领域记录（by id）
	 */
	public TbExpertArea findByExpAreaID(String expertAreaID) {
		if (expertAreaID!=null) {
			return hmkTbExpertAreaDAO.findById(expertAreaID);
		} else {
			return null;
		}
	}

	/*
	 * 保存和或更新专家领域记录
	 */
	public void saveExpertArea(TbExpertArea expertArea) {
		if (expertArea!=null) {
			expertArea.setA(IDUtil.PRESERVE);
			hmkTbExpertAreaDAO.attachDirty(expertArea);
		}
		
	}

	public void setHmkTbExpertAreaDAO(HmkTbExpertAreaDAO hmkTbExpertAreaDAO) {
		this.hmkTbExpertAreaDAO = hmkTbExpertAreaDAO;
	}

}
